home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Tech Arsenal 1
/
Tech Arsenal (Arsenal Computer).ISO
/
tek-11
/
fprotems.zip
/
PROWINDO.TEM
< prev
next >
Wrap
Text File
|
1993-01-04
|
3KB
|
111 lines
<<title Template for FoxPro windows>>
<<uicode>>
* PROWINDO.TEM
* Last modified 12/19/89
* load libraries used by this template
load_lib("prowindo")
<<enduicode>>
<<* program header>>
*** {file} : Code to define and display FoxPro windows.
*** Generated: {template}, {date}, {time} from {wwfile} screen.
*** DBF setup
<<init_all_dbfs()>>
<<* init and locate fields>>
<<declare_field_dupes()>>
<<for all fields where field.input>>
{dupe_name(field)} = {var_init_val(field)}
<<if len(field.owner.name)>>
* {field.name} lives in {field.owner.name} WINDOW
<<else>>
{field.name} doesn't live in a window.
<<endif>>
<<endfor>>
<<*init and locate memvars>>
<<for all memvars where memvar.input>>
<<init_var(memvar)>>
<<* {memvar.name} lives in {memvar.owner.name} WINDOW>>
<<if len({memvar.owner.name})>>
* {memvar.name} lives in {memvar.owner.name} WINDOW.
<<else>>
* {memvar.name} doesn't live in a window.
<<endif>>
<<endfor>>
<<for all memvars where ! memvar.input>>
<<init_var(memvar)>>
<<if len(memvar.owner.name)>>
* {memvar.name} lives in {memvar.owner.name} WINDOW
<<else>>
* {memvar.name} doesn't live in a window.
<<endif>>
<<endfor>>
<<write_testcode()>>
*** define each window
PROCEDURE WINDEFS
<<declare_all_windows()>>
<<uicode>>
for all boxes where at("WINDOW", upper(box.descrip))
? 'PROCEDURE open{substr(box.name,1,4)}'
? ' IF WEXIST("{box.name}") ' ** If window previously defined,
? ' IF WVISIBLE("{box.name}")' ** and is on screen already,
? ' RELEASE WINDOWS {box.name}' ** release it to avoid error.
? ' ENDIF '
? ' ENDIF'
? 'ACTIVATE WINDOW {box.name}'
? '* interior text of {box.name} window'
write_window_text(box)
*** display non-input fields and memory variables
for all vars where ! var.input .and. var.owner = {box}
say_var_in_window(box,var)
endfor
*** position input fields and memory variables in the window
for all fields
if field.owner = {box} .and. field.input
get_field_dupe_in_window(box,field)
endif
endfor
*** put the input memvars in the window
for all memvars
if memvar.owner = {box} .and. memvar.input
get_var_in_window(box,memvar)
endif
endfor
if box_wants_input()
* i.e., has any variable that is tagged 'input' in there.
? 'READ'
endif
? 'RETURN'
?
endfor
***********for_testing*********************
function write_testcode **
*******************************************
* Call to this function can be commented out.
* Un-comment it to test the generated code from the Fox command surface.
? '* Code for TESTING {file} generated by PROWINDO.TEM in FoxPro '
? 'DO WINDEFS '
for all boxes where at("WINDOW", upper(box.descrip))
? 'DO open{substr(box.name,1,4)} '
next
? 'RETURN'
return
<<enduicode>>